import os

 

import gradio as gr

 

from main_wrapper import process_query  # 导入封装的处理函数

 

__AVATAR = ("../resource/avatar/user.jpg",
            "../resource/avatar/chatbot.jpeg")

 

 

def run_webui():
    chat_app = gr.ChatInterface(
        process_query,
        chatbot=gr.Chatbot(height=400, avatar_images=__AVATAR),
        textbox=gr.Textbox(placeholder="请输入你的问题", container=False, scale=7),
        title="「demo hahaha」",
        description="关于办公",
        theme="default",
        cache_examples=False,
        retry_btn=None,
        submit_btn="发送",
        stop_btn="停止",
        undo_btn="删除当前",
        clear_btn="清除所有",
        concurrency_limit=4,
    )

 

    chat_app.launch()

 

 

if __name__ == "__main__":
    run_webui()